{% extends "base_site.html" %}

{% block content %}
<link rel="stylesheet" type="text/css" href="/media/css/forms.css" />
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="/media/css/ie.css" /><![endif]-->
<script type="text/javascript" src="/admin/jsi18n/"></script>
<script type="text/javascript" src="/media/js/core.js"></script>
<script type="text/javascript" src="/media/js/calendar.js"></script>
<script type="text/javascript" src="/media/js/admin/DateTimeShortcuts.js"></script>
<script type="text/javascript" src="/media/js/jquery.min.js"></script>

<form action="" method="GET">
	{{ warn|safe }}
	<h class="datetime">Start Date: <input name="start" value="{{ start }}" class="vDateField" type="text" id="id_date_start" size="10" >
	&nbsp; &nbsp;
	<h class="datetime">End &nbsp;Date: <input name="end" value="{{ end }}" class="vDateField" type="text" id="id_date_end" size="10" />
	<input type="submit" value = "Show Date" />
	<input type="submit" name="refresh" value = "Refresh" />
</form>
<br><br>
<style>
	th {width:100px;}
</style>
<h2>1,项目运行情况&nbsp;&nbsp; <a href="/statistics/show/download/?{%if refresh%}refresh=true&{%endif%}action=sla&start={{ start }}&end={{ end }}">明细</a></h2>

<table>
<tr><th>指标名称</th><th>中断时长(分钟)</th><th>可用性</th><th>原因</th></tr>
{% for s in sla %}
<tr><td>{{ s.p }}</td><td>{{ s.badTime }}</td><td>{{ s.keyong }}</td><td></td></tr>
{% endfor %}
</table>
<form action="addcomment/">
<textarea style="width:1000px;height:100px;font-size:1.5em;text-shadow:1px 1px 3px rbga('50,50,50,0.8');" name="comment" cols="40" rows="7">{{ commentSLA.content }}</textarea>
<input type="hidden" name="type" value="sla">
<input type="hidden" name="time" value="{{ commentTime }}">
<input style="position:relative;top:80px;" type="submit" value="Save">
</form>
评论人员: {{ commentSLA.user.username }}   最后评论时间: {{ commentSLA.created_on|date:"Y-m-d H:i:s" }}


<h2>2,故障分析&nbsp;&nbsp; <a href="/statistics/show/download/?{%if refresh%}refresh=true&{%endif%}action=ticket&start={{ start }}&end={{ end }}">明细</a>&nbsp;&nbsp;&nbsp;<a href="/ticket/">Ticket list</a></h2>
<table><th>项目</th><th>故障类型</th><th>严重故障</th><th>一般故障</th><th>小计</th><th>故障类型比例%</th>
	{% for i in stc_incidents %}
	{% if forloop.last %}<tr style="background-color: #d0d0d0;"><td> STC {% else %}<tr><td>{% endif %}</td><td>{{ i.incidenttype }}</td><td>{{ i.serious }}</td><td>{{ i.minor }}</td><td>{{ i.subtotal }}</td><td>{{ i.rate }}%</td>
	</tr>
	{% endfor %}
	{% for i in voda_incidents %}
	 {% if forloop.last %}<tr style="background-color: #d0d0d0;"><td> voda {% else %}<tr><td>{% endif %}</td><td>{{ i.incidenttype }}</td><td>{{ i.serious }}</td><td>{{ i.minor }}</td><td>{{ i.subtotal }}</td><td>{{ i.rate }}%</td>
	</tr>
	{% endfor %}
	{% for i in zoota_incidents %}
	 {% if forloop.last %}<tr style="background-color: #d0d0d0;"><td> zoota_vivas {% else %}<tr><td>{% endif %}</td><td>{{ i.incidenttype }}</td><td>{{ i.serious }}</td><td>{{ i.minor }}</td><td>{{ i.subtotal }}</td><td>{{ i.rate }}%</td>
	</tr>
	{% endfor %}
</table>
<form action="addcomment/">
<textarea style="width:1000px;height:100px;font-size:1.5em;text-shadow:1px 1px 3px rbga('50,50,50,0.8');" name="comment" cols="40" rows="7">{{ commentTicket.content }}</textarea>
<input type="hidden" name="type" value="ticket">
<input type="hidden" name="time" value="{{ commentTime }}">
<input style="position:relative;top:80px;" type="submit" value="Save">
</form>
评论人员: {{ commentTop.user.username }}   最后评论时间: {{ commentTop.created_on|date:"Y-m-d H:i:s" }}


<h2>3,故障解决时间&nbsp;&nbsp; <a href="/statistics/show/download/?{%if refresh%}refresh=true&{%endif%}action=error&start={{ start }}&end={{ end }}">明细</a></h2>
<table>
<tr>
<th></th><th></th><th>重要服务</th><th></th><th></th><th>主要服务</th><th></th><th></th><th>一般服务</th></tr>
<tr><td>指标名称</td><td>各服务故障次数</td><td>平均解决时间(分钟)</td><td>及时率</td><td>各服务故障次数</td><td>平均解决时间(分钟)</td><td>及时率</td><td>各服务故障次数</td><td>平均解决时间(分钟)</td><td>及时率</td></tr>
{% for s in errors %}
<tr>
<td>{{ s.p }}</td><td>{{ s.grade.serious.error_times }}</td><td>{{ s.grade.serious.solveTimeAvg }}</td><td></td>
		<td>{{ s.grade.major.error_times }}</td><td>{{ s.grade.major.solveTimeAvg }}</td><td></td>
		<td>{{ s.grade.minor.error_times }}</td><td>{{ s.grade.minor.solveTimeAvg }}</td><td></td>
</tr>
{% endfor %}
</table>
<form action="addcomment/">
<textarea style="width:1000px;height:100px;font-size:1.5em;text-shadow:1px 1px 3px rbga('50,50,50,0.8');" name="comment" cols="40" rows="7">{{ commentError.content }}</textarea>
<input type="hidden" name="type" value="error">
<input type="hidden" name="time" value="{{ commentTime }}">
<input style="position:relative;top:80px;" type="submit" value="Save">
</form>
评论人员: {{ commentError.user.username }}   最后评论时间: {{ commentError.created_on|date:"Y-m-d H:i:s" }}


<h2>4,top10异常服务&nbsp;&nbsp; <a href="/statistics/show/download/?{%if refresh%}refresh=true&{%endif%}action=top&start={{ start }}&end={{ end }}">明细</a></h2>
<table>
<th>序号</th><th>项目</th><th>服务</th><th>故障次数</th>
{% for e in toperror %}
<tr>
<td>{{ forloop.counter }}</td><td>{{ e.project }}</td><td>{{ e.service }}</td><td>{{ e.error_times }}</td>
</tr>
{% endfor %}
</table>
<form action="addcomment/">
<textarea style="width:1000px;height:100px;font-size:1.5em;text-shadow:1px 1px 3px rbga('50,50,50,0.8');" name="comment" cols="40" rows="7">{{ commentTop.content }}</textarea>
<input type="hidden" name="type" value="top">
<input type="hidden" name="time" value="{{ commentTime }}">
<input style="position:relative;top:80px;" type="submit" value="Save">
</form>
评论人员: {{ commentTop.user.username }}   最后评论时间: {{ commentTop.created_on|date:"Y-m-d H:i:s" }}








{% endblock %}
